<template>
	<view class="container">
		<view class="flex diygw-col-24 justify-start flex-nowrap flex-clz">
			<view class="flex diygw-col-3 avatar1-clz">
				<view @tap="navigateTo" data-type="page" data-url="/pages/chuangyezhegerenzhongxin" class="diygw-avatar sm white radius">
					<text class="diy-icon-back_android"></text>
				</view>
			</view>
			<view class="diygw-col-0 text-clz"> 已发布的项目 </view>
		</view>
		<view v-for="(item, index) in published.data.list" :key="index" class="flex flex-wrap diygw-col-24 flex-direction-column flex8-clz">
			<view class="flex diygw-col-24 justify-around flex-nowrap flex7-clz">
				<view class="flex diygw-col-0 justify-center">
					<view v-for="(item, index) in published.data.list" :key="index" class="diygw-avatar xs radius bg-none">
						<image mode="aspectFit" class="diygw-avatar-img radius" :src="item.picture_"></image>
					</view>
				</view>
				<view class="flex diygw-col-24 flex-direction-column justify-start flex-wrap flex3-clz">
					<view class="flex flex-wrap diygw-col-0 flex4-clz">
						<view class="diygw-col-0 text2-clz">
							{{ item.project_name_ }}
						</view>
						<view class="diygw-col-0">
							{{ item.project_type_ }}
						</view>
					</view>
					<view class="flex flex-wrap diygw-col-24 flex-direction-column flex1-clz">
						<view class="flex flex-wrap diygw-col-0 flex9-clz">
							<view class="diygw-col-0 text6-clz">
								{{ item.need_type_ }}
							</view>
							<view class="diygw-col-0">
								{{ item.type_value_ }}
							</view>
						</view>
						<view class="flex flex-wrap diygw-col-0 flex10-clz">
							<view class="diygw-col-0 text9-clz">
								{{ item.need_detail_ }}
							</view>
							<view class="diygw-col-0">
								{{ item.detail_value_ }}
							</view>
						</view>
					</view>
				</view>
				<view class="flex diygw-col-0 justify-end items-end flex-nowrap flex12-clz">
					<view class="flex diygw-col-0 justify-end avatar2-clz">
						<view class="diygw-avatar xs radius">
							<text class="diy-icon-commentfill"></text>
						</view>
					</view>
					<view class="diygw-col-0 text14-clz"> 256 </view>
				</view>
			</view>
			<view class="flex flex-wrap diygw-col-24 justify-end flex27-clz">
				<view class="flex diygw-col-5">
					<button class="diygw-btn line-orange radius flex1 margin-xs button4-button-clz">编辑</button>
				</view>
				<view class="flex diygw-col-0">
					<button class="diygw-btn orange radius flex1 margin-xs button7-button-clz">优选发布</button>
				</view>
			</view>
		</view>
		<view class="clearfix"></view>
	</view>
</template>

<script>
	//create by: 邓志锋 <280160522@qq.com> <https://www.diygw.com> DIYGW可视化设计一键生成源码
	export default {
		data() {
			return {
				//用户全局信息
				userInfo: {},
				published: {
					code: '200',
					data: {
						count: 2,
						list: [
							{
								project_type_: '教育业',
								user_phone_: '123',
								project_id_: '434559717528043521',
								user_name_: '用户4',
								detail_value_: '100',
								id_: '434559717528043521',
								type_value_: '7%股份',
								project_status: '成交',
								need_detail_: '打印机',
								project_name_: '作业帮2',
								user_id_: '434444372742504449',
								need_type_: '人才',
								picture_: 'image4',
								project_desc_: '项目简介项目简介'
							},
							{
								project_type_: '食品业',
								user_phone_: '123',
								user_id_: '434444372742504449',
								user_name_: '用户4',
								id_: '434559825713037314',
								project_status: '成交',
								picture_: 'image4',
								project_desc_: '项目简介',
								project_name_: '汇源果汁3'
							}
						]
					},
					isOk: true
				}
			};
		},
		onShow() {
			this.setCurrentPage(this);
		},
		onLoad(option) {
			this.setCurrentPage(this);
			if (option) {
				this.setData({
					globalOption: this.getOption(option)
				});
			}

			this.init();
		},
		methods: {
			async init() {
				await this.publishedApi();
			},
			// 已发布项目接口 API请求方法
			async publishedApi() {
				let published = await this.$http.post(
					'https://agent.diygw.com/',
					{
						url: '/form/formCustSql/view/liststr_%E5%B7%B2%E5%8F%91%E5%B8%83%E9%A1%B9%E7%9B%AE%E6%8E%A5%E5%8F%A3',
						method: 'post',
						headers: {
							'Content-Type': 'application/x-www-form-urlencoded'
						},
						param: this.globalOption.id || '{"curPage":1,"pageSize":10,"params":"{"isLocalPreview":"1","user_id_":"434444372742504449","queryData":[{"name":"user_id_","con":"like","val":"434444372742504449"}]}"}'
					},
					{
						'Content-type': 'application/json'
					},
					'json'
				);
				this.published = published;
			}
		}
	};
</script>

<style lang="scss" scoped>
	.flex-clz {
		box-shadow: 0px 3px 3px rgba(31, 31, 31, 0.16) inset;
		overflow: hidden;
		flex: 1;
		border-bottom: 3px solid #eee;
	}
	.avatar1-clz {
		margin-left: 10px;
		font-weight: bold;
		width: calc(12.5% - 10px - 5px) !important;
		font-size: 16px;
		margin-top: 10px;
		margin-bottom: 5px;
		margin-right: 5px;
	}
	.text-clz {
		margin-left: 100px;
		padding-top: 10px;
		font-weight: bold;
		padding-left: 0px;
		font-size: 15px;
		padding-bottom: 0px;
		margin-top: 5px;
		margin-bottom: 5px;
		text-align: center;
		margin-right: 5px;
		padding-right: 0px;
	}
	.flex8-clz {
		border: 1px solid #989592;
		padding-top: 0px;
		border-bottom-left-radius: 6px;
		padding-left: 0px;
		padding-bottom: 0px;
		border-top-right-radius: 6px;
		margin-right: 5px;
		margin-left: 5px;
		box-shadow: 0px 1px 3px rgba(31, 31, 31, 0.16);
		overflow: hidden;
		width: calc(100% - 5px - 5px) !important;
		border-top-left-radius: 6px;
		margin-top: 5px;
		border-bottom-right-radius: 6px;
		margin-bottom: 5px;
		padding-right: 0px;
	}
	.flex3-clz {
		margin-left: 15px;
		width: calc(100% - 15px - 5px) !important;
		margin-top: 5px;
		margin-bottom: 5px;
		margin-right: 5px;
	}
	.text2-clz {
		font-weight: bold;
	}
	.text6-clz {
		font-weight: bold;
	}
	.text9-clz {
		font-weight: bold;
	}
	.avatar2-clz {
		margin-left: 5px;
		background-size: 100% 100%;
		margin-top: 15px;
		margin-bottom: 5px;
		margin-right: 0px;
	}
	.text14-clz {
		margin-left: 5px;
		margin-top: 5px;
		margin-bottom: 10px;
		margin-right: 5px;
	}
	.button4-button-clz {
		margin: 3px !important;
	}
	.button7-button-clz {
		margin: 3px !important;
	}
	.container {
		padding-left: 0px;
		padding-right: 0px;

		font-size: 12px;
	}
	.container {
	}
</style>
